<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //全局作用域  都能访问
    //局部作用域  只能当前函数可以访问
    var a = 100;
    function fun1(){
        var a =200;
        var b = 100;
        c = 300; //全局变量
        console.log(a);
        console.log(c);
    }
    function fun2(){
        console.log(a );
        //console.log(b);
        console.log(c);
    }
    fun1()
    fun2()
</script>
</html>